package com.csun.dsms.service.impl;

import com.csun.dsms.comment.core.support.BaseService;
import com.csun.dsms.mapper.YcAlertMapper;
import com.csun.dsms.mapper.YsClassesMapper;
import com.csun.dsms.model.domain.YcAlert;
import com.csun.dsms.model.domain.YsClasses;
import com.csun.dsms.model.dto.yc.YcDeviceQueryDto;
import com.csun.dsms.model.dto.ys.YsQueryDto;
import com.csun.dsms.service.YcAlertService;
import com.csun.dsms.service.YsClassesService;
import com.github.pagehelper.PageHelper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class YsClassesServiceImpl extends BaseService<YsClasses> implements YsClassesService {

    @Resource
    private YsClassesMapper ysClassesMapper;

    @Override
    public Integer addClasses(YsClasses ysClasses) {
        return ysClassesMapper.insertSelective(ysClasses);
    }

    @Override
    public Integer deleteClasses(Long id) {
        return ysClassesMapper.deleteByPrimaryKey(id);
    }

    @Override
    public Integer editClasses(YsClasses ysClasses) {
        return ysClassesMapper.updateByPrimaryKeySelective(ysClasses);
    }

    @Override
    public List<YsClasses> queryListWithPage(YsQueryDto ysQueryDto) {
        PageHelper.startPage(ysQueryDto.getPageNum(),ysQueryDto.getPageSize());
        return ysClassesMapper.queryListWithPage(ysQueryDto);
    }

    @Override
    public List<YsClasses> queryListByTeacher(YsQueryDto ysQueryDto) {
        return ysClassesMapper.queryListByTeacher(ysQueryDto);
    }
}
